package com.tobie.info.controller;

import com.tobie.info.entity.HotelEntity;
import com.tobie.info.entity.RoomEntity;
import com.tobie.info.service.IRoomService;
import com.tobie.info.util.ResultVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author lc
 * @Date 2023/11/20 9:20
 * @注释 房间页面控制器
 */
@Slf4j
@RestController
@RequestMapping("/room")
public class RoomController {
    @Resource
    private IRoomService roomService;

    @GetMapping("/getAllRoom")
    public ResultVo<List<RoomEntity>> getAllRoom(){
        return ResultVo.success(roomService.getAllRoom());
    }

    @GetMapping("/getRoomByHotelName/{hotelName}")
    public ResultVo<List<RoomEntity>> getRoomByHotelName(String hotelName){
        return ResultVo.success(roomService.getRoomByHotelName(hotelName));
    }
}
